home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-11
/
clipdbug.zip
/
CLIPDBG.DOC
< prev
next >
Wrap
Text File
|
1993-01-04
|
8KB
|
178 lines
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
▓▓░░ ░░
▓▓░░ ░░
▓▓░░ CLIPDBG!: THE POOR MAN'S ░░
▓▓░░ CLIPPER SOURCE CODE DEBUGGER! ░░
▓▓░░ ░░
▓▓░░ VERSION 1.00 ░░
▓▓░░ ░░
▓▓░░ WRITTEN BY DARREN J. FORCIER ░░
▓▓░░ ░░
▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
INTRODUCTION
Welcome, fellow Clipper programmer to CLIPDBG!, the ultimate in shareware
source code debugging for Clipper. With CLIPDBG!, you can get all the
benefits of the Nantucket Integrated Debugger, with the added extra of
actually being able to trace your source code as it executes! This can
save you hours of costly debugging time, especially on those hard to
trace logic loops and errant if/case structures which drives most of us
rabid. Let me give you a little background on why I have created this
Clipper utility.
I have been programming in dBase and Clipper for a few years. At one
point in my career I had been doing a project in Microsoft 'C' and was
introduced to the wonders of Microsoft Codeview, a source level debugging
utility. I was writing a sales tracking system for an Auto Dealership,
and they wanted it to be fairly portable to different hardware platforms,
hence I chose 'C' instead of dBase/Clipper at the time. To make a long
story short, I had about 10,000 lines of C code, and found the project
had grown enormously. I found using Codeview to trace through my programs
and view my source code as it executed saved me many hours of endless
debugging with coding watch variables and trace point statements embedded
in the source code. I solved more stray loops, errant case structures
and uninitialized pointers than I would have thought humanly possible.
After that project was over, I was back to programming in Clipper for my
next project, this time with the Summer '87 version. I was thrilled to
find that they had greatly improved their debugger from the Autumn '86
version. But alas, to my dismay, they didn't offer source level debugging
like Codeview did. So for a few months, I pretty much bit the bullet,
and worked with the debugger as it stood. Now don't get me wrong, with
single stepping, watch points, break points, and everything else but
source level debugging, the Nantucket debugger is still a pretty kick-a**
debugger. But it still wasnt the same.
Then one night I was dreaming about programming (I do that sometimes), and
I saw a way to possibly create a codeview style source window in the
debugger, to trace source code statements as they execute. Hence I got up,
got the coffee flowing, and worked on my first prototype of a source
level debugger for Clipper. The rest, they say, is history.
THE DEBUGGER
CLIPDBG! consists of a Clipper format .OBJ module which you link into
your application and call through the Nantucket Debugger. Before you
link it into your application, you must do the following:
1. Insert the following lines of code at the top of each module you
want to debug:
PUBLIC _SRC, _SDDEBUG
Status = SDINIT("<SOURCFILE>")
ALTD()
ALTG(.T.)
where <SOURCEFILE> is the .PRG filename of the module to debug. Be
sure to include the .PRG extension, and wrap quotes around it. The
ALTD() Enables the Clipper Debugger. ALTG(.T.) enables CLIPDBG!.
Note that you only have to enable the Clipper debugger once, at the
top file (usually a main menu or something) in your system. The
Status field is an optional return variable you can use to test the
success status of the SDINIT function. A returned value of 0 means
success, and a value of -1 means the source code file could not
be loaded, most likely because it isn't in the current directory. Note
that you may put a directory path in front of the source file name
in SDINIT.
2. Insert the following line of code at the top of all modules you DO NOT
wish to trace through:
ALTG(.F.)
Now you are ready to debug your application. Make sure you link in
Nantucket's DEBUG.OBJ, and CLIPDBG.OBJ into your application. When
you run your program, you will see the Clipper Debugger's window appear.
At the window, toggle over to the watch menu. At this point you will
add a watch for the following:
SDBUG(_SRC,PROCLINE())
Make sure you type it in exactly. If you have done this correctly you
will see the source window open up. If you have not, you will see the
message <UNDEFINED> in the watch window. When you have your source code
up, you may now go over to the Control menu, and chose your options (Go,
Go Animation, Go Key, Single Step.) For maximum debugging control, I
recommend single step, although in Go Animation mode the program flows
at a reasonable speed for viewing the source code. Note that you may
also specify any other watchpoints you wish in the watch window, and
do any other Nantucket debugger options you wish.
DISABLING THE DEBUGGER
For the most part, the debugger will stay on until a source file is
encountered with an ALTG(.F.) in it. This will turn off the debugger,
and clear out the window which was displaying the source. There is
also a hot key set up to toggle CLIPDBG! on or off. This is ALT-G, and
will temporarily turn the debugger off. Unfortunately at this point
I haven't figured out a decent buffering scheme to keep the underlying
screen intact, but that will come eventually. At any rate, if you are
trying to debug a section of source code, you are more concerned with
watching the statements flow anyway. Once you get past the logic problems,
you can remove the CLIPDBG! initialization (or comment it out), and
your program will run normally.
NOW THE NITTY-GRITTY STUFF: LICENSING, MONEY, ETC.
Yes folks, you guessed it, I am now going to make a sales pitch. Here
goes:
If you find CLIPDBG! useful (I am sure you will, it has already helped
me, and I wrote it!), I would greatly appreciate your registering it.
I have basically one fee: $20.00 which will entitle you to a full site
license, updates and new features as I create them, and the source code,
so you can see how I created this neat little utility. If you wish
to register it, send a check or M.O. to the following Address:
Darren J. Forcier
Forcier Computer Services
R.F.D. #2 Box 138
Southbridge, Ma. 01550
Tel No. 413-245-6687.
Please make checks payable to Darren J. Forcier. Upon receipt of your
registration fee I will mail you a diskette containing the latest
version of the program, source code, and a little personal letter
to you, thanking you for your patronage. (No mail merge, it WILL be
personalized.)
Thank you. Good luck with it. If anyone finds any problems or bugs,
please let me know about them, even if you don't register. I am on
the Source from time to time at BGC103, and Compuserve at 72117,1632.
I also frequent the DataBased Advisor ForumBoard BBS. Happy Clipping!